<?php

class Zml_Transform
{
    public static function ruTransform($value = null)
    {
        $transform = array(
            'А' => 'A',    'а' => 'a',
            'Б' => 'B',    'б' => 'b',
            'В' => 'V',    'в' => 'v',
            'Г' => 'G',    'г' => 'g',
            'Д' => 'D',    'д' => 'd',
            'Е' => 'E',    'е' => 'e',
            'Ё' => 'E',    'ё' => 'e',
            'Ж' => 'Zh',   'ж' => 'zh',
            'З' => 'Z',    'з' => 'z',
            'И' => 'I',    'и' => 'i',
            'Й' => 'Y',    'й' => 'y',
            'К' => 'K',    'к' => 'k',
            'Л' => 'L',    'л' => 'l',
            'М' => 'M',    'м' => 'm',
            'Н' => 'N',    'н' => 'n',
            'О' => 'O',    'о' => 'o',
            'П' => 'P',    'п' => 'p',
            'Р' => 'R',    'р' => 'r',
            'С' => 'S',    'с' => 's',
            'Т' => 'T',    'т' => 't',
            'У' => 'U',    'у' => 'u',
            'Ф' => 'F',    'ф' => 'f',
            'Х' => 'Kh',   'х' => 'kh',
            'Ц' => 'Ts',   'ц' => 'ts',
            'Ч' => 'Ch',   'ч' => 'ch',
            'Ш' => 'Sh',   'ш' => 'sh',
            'Щ' => 'Sc',   'щ' => 'sc',
            'Ъ' => '',     'ъ' => '',
            'Ы' => 'Y',    'ы' => 'y',
            'Ь' => '',     'ь' => '',
            'Э' => 'E',    'э' => 'e',
            'Ю' => 'Yu',   'ю' => 'yu',
            'Я' => 'Ya',   'я' => 'ya',
        );
        $konform_temp = strtr($value, $transform);
        
        $transform = array(
            '(' => '',
            ')' => '',
            '{' => '',
            '}' => '',
            '[' => '',
            ']' => '',
            '!' => '',
            '"' => '',
            '#' => '',
            '%' => '',
            '&' => '-',
            "'" => '',
            '`' => '',
            ',' => '',
            '.' => '',
            ':' => '',
            ';' => '',
            '<' => '',
            '=' => '',
            '>' => '',
            '?' => '',
            '^' => '',
            '|' => '-',
            '/' => '-',
            "\\" => '-',
            ' ' => '-',
        );
        $konform_temp = strtr($konform_temp, $transform);
        
        $transform = array(
            '---' => '-',
            '--'  => '-',
        );
        $konform_temp = strtr($konform_temp, $transform);
        
        return $konform_temp;
    }
}